package com.ysyx.ysyx_passengerconfirmo.utils;

import java.text.DecimalFormat;

/**
 * Created by IntelliJ IDEA.
 *
 * @description: xxxx接口/类
 * @author:郭宇轩
 * @create:2023/4/11 19:45
 */
public class CostCalcUtils {

    public static Double costCalc(Double mileage){
        Double cost = new Double(0.00);
        DecimalFormat df = new DecimalFormat( "0.00"); //设置double类型小数点后位数格式
        cost = 1.7*mileage;
        cost = Double.valueOf(df.format(cost));
        if(cost < 10){
            cost = 10.00;
        }
        return cost;
    }
}
